package com.sundi.ecgoods.web;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.sundi.ecgoods.entity.EcCategory;
import com.sundi.ecgoods.service.IEcCategoryService;
import com.sundi.ecgoods.vo.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 类目表 前端控制器
 * </p>
 *
 * @author jgn
 * @since 2020-02-25
 */
@RestController
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    IEcCategoryService categoryService;

    @RequestMapping("list")
    public ResultEntity list(){
        Wrapper<EcCategory> wrapper = new EntityWrapper<>();
        List<EcCategory> categorys = categoryService.selectList(wrapper);
        return ResultEntity.ok(categorys);
    }

}

